package com.geega.geetest.core;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.util.List;
import java.util.Map;

@Data
public class QueryCondition {

    @Min(value = 1)
    @Max(value = Integer.MAX_VALUE)
    private Integer pageNum = 1;

    @Min(value = 1)
    @Max(value = Integer.MAX_VALUE)
    private Integer pageSize = Integer.MAX_VALUE;

    private Map<String, String> orderMap = Maps.newLinkedHashMap();

    private List<Attribute> whereList = Lists.newArrayList();

    @Data
    public static class Attribute {
        private String key;
        private String val;
        private String opt;
    }
}
